#include <iostream>
#include <pthread.h>
#include "Producer.h"
#include "TaskQueue.h"
#include <stdlib.h>
#include <thread>
using std::cout;
using std::endl;

void Producer::produce(TaskQueue & que){
    int cnt=20;
    srand(time(nullptr));
    while(--cnt){
        int num = rand()%100;
        que.push(num);
        cout << "push number:"<<num<<endl;
        std::this_thread::sleep_for(std::chrono::seconds(1));
    }
}

